<script setup>
import {useRoute} from "vue-router";
import {onMounted, reactive, ref} from "vue";
import {get} from "@/utils/request.js";
import * as echarts from "echarts";

const route = useRoute()
//params
const id = route.query.id;
let data = reactive({
  process:{

  }
})

onMounted(async () => {
  let res = await get("/api/process/detail/" + id);
  data.process = res.data;

})



const onClickLeft = () => history.back();

</script>

<template>
  <div id="process-detail">
    <div class="title">
      <van-nav-bar title="详情" left-text="返回" @click-left="onClickLeft"></van-nav-bar>
    </div>
    <div>
      <van-form>
        <van-cell-group inset>
          <van-field
              v-model="data.process.productName"
              name="产品"
              label="产品"
              placeholder="产品"
              :rules="[{ required: true, message: '产品' }]"
              disabled
          >
            <template #input>
              <van-radio-group v-model="data.process.productName" direction="horizontal" disabled>
                <van-radio name="卡子">卡子</van-radio>
                <van-radio name="钩子">钩子</van-radio>
              </van-radio-group>
            </template>
          </van-field>
          <van-field
              v-model="data.process.productColor"
              name="产品颜色"
              label="产品颜色"
              placeholder="产品颜色"
              :rules="[{ required: true, message: '请填写产品颜色' }]"
              disabled
          >
            <template #input>
              <van-radio-group v-model="data.process.productColor" direction="horizontal" disabled>
                <van-radio name="黑">黑</van-radio>
                <van-radio name="白">白</van-radio>
              </van-radio-group>
            </template>
          </van-field>
          <van-field
              v-model="data.process.productCategory"
              name="型号"
              label="型号"
              placeholder="型号"
              :rules="[{ required: true, message: '请填写型号' }]"
              disabled
          >
            <template #input>
              <van-radio-group v-model="data.process.productCategory" direction="horizontal" disabled>
                <van-radio name="大">大</van-radio>
                <van-radio name="中">中</van-radio>
                <van-radio name="小">小</van-radio>
              </van-radio-group>
            </template>
          </van-field>
          <van-field
              name="重量"
              label="重量"
              placeholder="重量"
              v-model="data.process.weight"
              :rules="[{ required: true, message: '请填写重量' }]"
              disabled
          >
            <template #extra>
              <span>KG</span>
            </template>
          </van-field>

          <van-field
              v-model="data.process.purchaser"
              name="加工商"
              label="加工商"
              placeholder="加工商"
              left-icon="contact-o"
              :rules="[{ required: true, message: '请填写加工商' }]"
              disabled
          >
          </van-field>

          <van-field
              v-model="data.process.director"
              name="经办人"
              label="经办人"
              placeholder="经办人"
              left-icon="user-o"
              :rules="[{ required: true, message: '请填写经办人' }]"
              disabled
          >
          </van-field>
          <van-field
              v-model="data.process.recordType"
              name="记录方式"
              label="记录方式"
              placeholder="记录方式"
              :rules="[{ required: true, message: '请填写记录方式' }]"
              disabled
          >
            <template #input>
              <van-radio-group v-model="data.process.recordType" direction="horizontal" disabled>
                <van-radio name="记账">记账</van-radio>
                <van-radio name="未开票">未开票</van-radio>
              </van-radio-group>
            </template>
          </van-field>
        </van-cell-group>
      </van-form>
    </div>
  </div>
</template>

<style scoped>

</style>